<?php
/**
 * This file contains the class EditFuneralHomeModel which provides
 * all of the text requirements for the editfuneralhome.php page
 *
 * @copyright  2009 A Memory Tree
 * @license    A Memory Tree License
 * @version    $Id:$
 * @link       http://my-trac.assembla.com/amemorytree/ticket/??
 * @since      File available since Release 0.1
 */
/**
 * This class provides the model for editfuneralhome.php
 *
 * @copyright  2009 A Memory Tree
 * @license    A Memory Tree License
 * @version    Release: @package_version@
 * @link       http://my-trac.assembla.com/amemorytree/ticket/??
 * @since      Class available since Release 0.1
 */
class EditFuneralHomeModel
{
    /**
     * Reference to the funeral home database class
     *
     * @var FuneralHomeDB
     */
    private $_funeralHomeDB;
    /**
     * Create a new instance of the funeral home model
     *
     * @param FuneralHomeDB &$funeralHomeDB
     */
    public function __construct(&$funeralHomeDB)
    {
        $this->_funeralHomeDB = $funeralHomeDB;
    }
    /**
     * Check for duplicate funeral home names
     *
     * @return bool
     * @param mixed $funeralName
     * @param mixed $funeralId
     */
    function checkDuplicateFuneralHomes($funeralName, $funeralId)
    {
        $duplicates = $this->_funeralHomeDB->countDuplicateFuneralNames($funeralName, $funeralId);
    $hasDuplicates = $duplicates > 0;
        return $hasDuplicates;
    }
}
